<?php
/**
 * The template for displaying the home page.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package toekneestuck
 * @subpackage toekneestuck
 * @since toekneestuck 2.0
 */

get_header(); 

if( have_posts() ) while( have_posts() ): the_post(); 
?>
<section class="container splash hbox clearfix">
	<div class="row">
		<div class="logo left">
			<img src="<?php echo home_url( get_bloginfo('template_url') . '/img/logo-toekneestuck-large.png'); ?>" width="208" height="400" alt="Tony Stuck Logo" />
		</div>
		<article><?php the_content(); ?></article>
	</div>
</section>
<?php endwhile; ?>
<section class="container dark hbox clearfix" id="blog-preview">
	<aside class="row">
		<h3 class="headline">Latest Posts</h3>
		<?php
			$total = 3; 
			$latest_posts = get_posts( array('numberposts' => $total) );
			foreach( $latest_posts as $key=>$post ): 
				setup_postdata($post); 
				$last = ($key+1 == $total) ? ' last' : ''; 
		?>
		<article <?php post_class('fourcol'.$last) ?>>
			<hgroup>
				<h2><?php  
					printf('<a href="%1$s" title="%2$s">%3$s</a>',
						get_permalink(),
						sprintf( esc_attr__( 'Permalink to %s', 'toeknee' ), the_title_attribute( 'echo=0' )),
						get_the_title()
					);
				?></h2>
				<h6 class="meta-category"><?php the_category(' ') ?></h6>
			</hgroup>
			<div class="details"><?php 
				toeknee_the_date();
				echo ' &bull; ';
				comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments-link');
				the_tags('<span class="block meta-category">Tagged in ', ', ', '</span>') ?>
			</div>
		</article>
		<?php endforeach; wp_reset_postdata(); ?>
	</aside><!-- /.row -->
</section>
<section class="container hbox light clearfix" id="highlights">
	<div class="row">
		<?php get_sidebar('home'); ?>
	</div>
</section>
<?php get_footer(); ?>